package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.LyricsDAO;
import cn.nebula.music.domain.Lyrics;

@Component
public class StringToLyricsConverter implements Converter<String,Lyrics>{

	@Autowired
	private LyricsDAO lyricsDAO;
	
	@Override
	public Lyrics convert(String source) {
		return lyricsDAO.findLyricsById(Integer.valueOf(source));
	}
	
}
